﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Forms.ConfigForm.Children
{
    public partial class Behavior : Krile.Kernel.Control.ConfigPage
    {
        public Behavior()
        {
            InitializeComponent();
        }

        private void Behavior_Load(object sender, EventArgs e)
        {
            ConfirmOnCloseTab.Checked = Core.Config.Behavior.ConfirmOnCloseTab;
            ClickSelectedStatusToDeselect.Checked = Core.Config.Behavior.ClickSelectedStatusToDeselect;
            ReloadOnGTLImplyStateChanged.Checked = Core.Config.Behavior.ReloadOnGTLImplyStateChanged;
            PointingNameToSelectStatus.Checked = Core.Config.Behavior.PointingNameToSelectStatus;
            ClosePostboxAfterPost.Checked = Core.Config.Behavior.ClosePostboxAfterPost;
            ClearReplyOnClosePostbox.Checked = Core.Config.Behavior.ClearReplyOnClosePostBox;
            ConfirmOnCloseWindow.Checked = Core.Config.Behavior.ConfirmOnCloseWindow;
            DetouchableTab.Checked = Core.Config.Behavior.DetouchableTabWithMouse;
        }

        public override void Apply()
        {
            Core.Config.Behavior.ClearReplyOnClosePostBox = ClearReplyOnClosePostbox.Checked;
            Core.Config.Behavior.ClosePostboxAfterPost = ClosePostboxAfterPost.Checked;
            Core.Config.Behavior.ConfirmOnCloseTab = ConfirmOnCloseTab.Checked;
            Core.Config.Behavior.PointingNameToSelectStatus = PointingNameToSelectStatus.Checked;
            Core.Config.Behavior.ClickSelectedStatusToDeselect = ClickSelectedStatusToDeselect.Checked;
            Core.Config.Behavior.ReloadOnGTLImplyStateChanged = ReloadOnGTLImplyStateChanged.Checked;
            Core.Config.Behavior.ConfirmOnCloseWindow = ConfirmOnCloseWindow.Checked;
            Core.Config.Behavior.DetouchableTabWithMouse = DetouchableTab.Checked;
            base.Apply();
        }
    }
}
